package com.tianluo.tianluobookstore.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import java.util.Base64;

@Configuration
public class AesConfig {
    @Value("${aes.secret.key}")
    private String secretKey;

    @Value("${aes.secret.iv}")
    private String initVector;

    public byte[] getSecretKey() {
        return Base64.getDecoder().decode(secretKey);
    }

    public byte[] getInitVector() {
        return initVector.getBytes();
    }
}

